﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZoneLineNew.Attributes;
using ZoneLineNew.Models.Entity.Base;

namespace ZoneLineNew.Models.Entity.StationResult {

    /// <summary>
    /// 数据结果基类
    /// </summary>
    public class StationResultBase : EntityBase {

        private string _absScanCode;
        /// <summary>
        /// 主减震器码
        /// </summary>
        [DgColumnAttr("减震器码")]
        public string AbsScanCode {
            get { return _absScanCode; }
            set { SetProperty(ref _absScanCode, value); }
        }

        private string _partType;
        /// <summary>
        /// 产品型号
        /// </summary>
        [DgColumnAttr("产品型号")]
        public string PartType {
            get { return _partType; }
            set { SetProperty(ref _partType, value); }
        }

        private string _result;
        /// <summary>
        /// 结果
        /// </summary>
        [DgColumnAttr("结果")]
        public string Result {
            get { return _result; }
            set { SetProperty(ref _result, value); }
        }

        private float _cycleTime;
        /// <summary>
        /// 循环时间
        /// </summary>
        [DgColumnAttr("循环时间")]
        public float CycleTime {
            get { return _cycleTime; }
            set { SetProperty(ref _cycleTime, value); }
        }

        private string _stationCode;
        /// <summary>
        /// 工位号
        /// </summary>
        [DgColumnAttr("工位号")]
        public string StationCode {
            get { return _stationCode; }
            set => SetProperty(ref _stationCode, value);
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DgColumnAttr("创建时间")]
        private DateTime _createTime = DateTime.Now;

        public DateTime CreateTime {
            get { return _createTime; }
            set { _createTime = value; }
        }

        private string _code;
        /// <summary>
        /// 合格标签二维码
        /// </summary>
        [DgColumnAttr("二维码")]
        public string Code {
            get { return _code; }
            set { SetProperty(ref _code, value); }
        }

        private bool _isReworked;
        /// <summary>
        /// 是否返工件
        /// </summary>
        public bool IsReworked {
            get { return _isReworked; }
            set { SetProperty(ref _isReworked, value); }
        }

        private long _productID;
        /// <summary>
        /// 产品ID
        /// </summary>
        public long ProductID {
            get { return _productID; }
            set { SetProperty(ref _productID, value); }
        }

        #region Ignore 辅助字段查询用
        private string _boxCodeView;
        /// <summary>
        /// 装箱码
        /// </summary>
        [DgColumnAttr("装箱码")]
        [FreeSql.DataAnnotations.Column(IsIgnore = true)]
        public string BoxCodeView {
            get { return _boxCodeView; }
            set { SetProperty(ref _boxCodeView, value); }
        }

        /// <summary>
        /// 是否返工
        /// </summary>
        [DgColumnAttr("是否返工")]
        [FreeSql.DataAnnotations.Column(IsIgnore = true)]
        public string IsReworkedLabel => IsReworked ? "是" : "否";
        #endregion

    }

}
